package com.jackiechan;


import com.jackiechan.domain.Students;
import com.jackiechan.util.MyBatisUtils;
import org.apache.ibatis.io.Resources;
import org.apache.ibatis.session.SqlSession;
import org.apache.ibatis.session.SqlSessionFactory;
import org.apache.ibatis.session.SqlSessionFactoryBuilder;

import java.io.IOException;
import java.io.InputStream;
import java.util.List;

public class MyApp2 {
    public static void main(String[] args) throws IOException {

        SqlSession sqlSession = MyBatisUtils.getSqlSession();
        String sqlId = "com.jackiechan.dao.StudentsDao" + "." + "selectStudents";

        List<Students> students =sqlSession.selectList(sqlId);

        students.forEach( stu -> System.out.println(stu));
        sqlSession.close();
    }
}
